from django.db import models
from django.contrib.auth.models import User
from catalogue.models import Foods
from django.utils import timezone

# Create your models here.


class Cart(models.Model):
    user = models.ForeignKey(
        User,
        null=True,
        blank=True,
        on_delete=models.CASCADE,
        related_name='carts',
    )
    fid = models.ForeignKey(
        Foods,
        null=True,
        blank=True,
        on_delete=models.CASCADE,
        related_name="carts",
    )
    count = models.PositiveIntegerField()
    created = models.DateTimeField(default=timezone.now)
